import request from '@/utils/request'

export function listCash(query) {
    return request({
        url: '/cash/list',
        method: 'get',
        params: query
    })
}

export function addCash(data) {
    return request({
        url: '/cash/addUpdateCash',
        method: 'post',
        data: data
    })
}
export function updateDinnerMx(data) {
    return request({
        url: '/cash/updateProCashItemForDinner',
        method: 'post',
        data: data
    })
}

export function reportCash(id) {
    return request({
      url: '/cash/reportCash/' + id,
      method: 'put'
    })
}

export function reportCashAgain(id) {
    return request({
      url: '/cash/reportCashAgain/' + id,
      method: 'put'
    })
}

export function showCash(data) {
    return request({
        url: '/cash/getCashById',
        method: 'get',
        params: data
    })
}

export function deleteCash(cashIds) {
    return request({
        url: '/cash/deleteCash/'+cashIds,
        method: 'delete',
    })
}

//打印用 获取报销基础数据
export function getBasicData(id) {
    return request({
      url: '/cash/getPrintMainInfo/' + id,
      method: 'get'
    })
}
//打印用，获取报销明细
export function getItemList(cashId) {
    return request({
        url: '/cash/itemList/' + cashId,
        method: 'get'
    })
}
//打印用，获取现金报销单明细
export function getItemMainList(cashId) {
    return request({
        url: '/cash/itemMainList/' + cashId,
        method: 'get'
    })
}
//打印用，获取pdf
export function getPDFFileList(cashId) {
    return request({
        url: '/cash/getPDFInfo/' + cashId,
        method: 'get'
    })
}
//获取报销单的附件
export function getFileInfoByCash(data) {
    return request({
        url: '/cash/getFileInfoByCash',
        method: 'get',
        params: data
    })
}
//导出明细表
export function exportMx(cashId) {
    return request({
        url: '/cash/mxExport/' + cashId,
        method: 'get'
    })
}
//导出报销单
export function exportBx(cashId) {
    return request({
        url: '/cash/bxExport/' + cashId,
        method: 'get'
    })
}
//导出传递清单
export function exportCdqd(cashId) {
    return request({
        url: '/cash/cdqdExport/' + cashId,
        method: 'get'
    })
}
//导出传递清单
export function exportAllFile(cashIds) {
    return request({
        url: '/cash/allExport/' + cashIds,
        method: 'get'
    })
}
export function personExport(cashId){
    return request({
        url: '/cash/personExport/' + cashId,
        method: 'get'
    })
}